// pages/card/card.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    card:{}
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this
    wx.request({
      url: 'https://www.easy-mock.com/mock/5d68bd1e48601505d3231b88/getCard',
      success:(res)=>{
        console.log(res.data.data)
        this.setData({
          card:res.data.data,
        })
      }
    })
  },
  bindchange: function (e) {
    const that = this;
    that.setData({
      currentData: e.detail.current
    })
  },
  //点击切换，滑块index赋值
  checkCurrent: function (e) {
    const that = this;
    if (that.data.currentData === e.target.dataset.current) {
      return false;
    } else {
      that.setData({
        currentData: e.target.dataset.current
      })
    }
  }
})

